<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="s"  uri="/struts-tags" %>
<%@ taglib prefix="c"  uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/html">
<head>
   	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <meta http-equiv="X-UA-Compatible" content="chrome=1">
	<title>菜单管理</title>
    <link href="<%=request.getContextPath()%>/css/bootstrap.css" rel="stylesheet" type="text/css">
    <script src="<%=request.getContextPath()%>/js/jquery-2.0.3.min.js" type="text/javascript"></script>
    <script src="<%=request.getContextPath()%>/js/bootstrap.js" type="text/javascript"></script>  
    
        
    <link rel="stylesheet" href="<%=request.getContextPath()%>/css/bootstrapValidator.css"/>
    <script type="text/javascript" src="<%=request.getContextPath()%>/js/bootstrapValidator.js"></script>
    
    
    <script type="text/javascript" src="<%=request.getContextPath()%>/js/lhdialog/lhgcore.min.js"></script>
    <script type="text/javascript" src="<%=request.getContextPath()%>/js/lhdialog/lhgdialog.js"></script>
    <script type="text/javascript" src="<%=request.getContextPath()%>/js/OpenDialog.js"></script>

    <script type="text/javascript">
    
    $(document).ready(function() {
    	
    	$('#defaultForm')
        .bootstrapValidator({
            message: 'This value is not valid',
            fields: {
                "t.name": {
                    validators: {
                        notEmpty: {
                            message: '商品系列名称不能为空'
                        }
                    }
                },
                "t.isKeyAttr": {
                    validators: {
                        notEmpty: {
                            message: '是否为属性键不能为空'
                        }
                    }
                }
            }
        })
    });

    </script>
</head>
<body>
<div class="panel panel-primary">
  <div class="panel-heading">商品属性管理</div>
  <div class="panel-body">
    
	  <form id="defaultForm" class="form-horizontal" action="productAttr/ProductAttr_save.action?page=${page}&t1.category.id=${t.category.id}&t1.category.name=${t.category.name}&t1.name=${t1.name}" method="post">
	     
	    <%--  <div class="form-group">
		    <label for="" class="col-sm-offset-3 col-sm-2 control-label" id="categoryNameMng">4级类别名称：</label>
		    <div class="col-sm-2">
                <input class="form-control" type="text" name="t.category.name" id="categoryName" readonly="readonly" value="${t.category.name }">
                <input type="hidden" name="t.category.id" id="categoryId" value="${t.category.id}">
		    </div>
		  </div> --%>
	  
		 <div class="form-group">
		    <label for="t.rolename" class="col-sm-offset-3 col-sm-2 control-label">属性名称：</label>
		    <div class="col-sm-2">
		    	<input type="hidden" name="t.category.id" id="categoryId" value="${t.category.id}">
		    	<input type="hidden" name="t.groupId" value="${t.groupId }">
		    	<input type="hidden" name="t1.groupId" value="${t.groupId }">
		        <input class="form-control" type="text" name="t.name" id="text" placeholder="请输入属性名称" value="${t.name}">
		    </div>
		  </div>
		  
		  
		  <div class="form-group">
		    <label for="t.rolename" class="col-sm-offset-3 col-sm-2 control-label">是否为属性键：</label>
		    <div class="col-sm-2">
		        <select name="t.isKeyAttr"  class="form-control">
		            <c:if test="${empty method}" >
			            <option value="">请选择</option>
			            <option value="1">是</option>
			            <option value="0">否</option>
			        </c:if>
			        <c:if test="${!empty method}" >
			            <c:if test="${t.isKeyAttr==0 }">
			                <option value="0">否</option>
			                <option value="1">是</option>
			            </c:if>
			            <c:if test="${t.isKeyAttr==1 }">
			                <option value="1">是</option>
			                <option value="0">否</option>
			            </c:if>
			        </c:if>
		        </select>
		    </div>
		  </div>

	      <c:if test="${!empty method}" >
	          <input name="method" type="hidden" value="${method }">
			  <input type="hidden" name="t.id" value="${t.id}">
			  <input type="hidden" name="t.creationTime" value="${t.creationTime}">
			  <input type="hidden" name="t.creator" value="${t.creator}">
			  
		  </c:if>
		 
		  <div class="form-group">
		    <div class="col-sm-offset-5 col-sm-7">
		      <button type="submit" class="btn btn-default">提交</button>
		      <button type="reset" class="btn btn-default">重置</button>
		    </div>
		  </div>
      </form>
    
  </div>
  
</div>

</body>
</html>
